#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include "printf.h"

RF24 rf(9, 10);

void setup(void)
{
  Serial.begin(9600);
  printf_begin();

  rf.begin();
  rf.setRetries(15,15);
  rf.setPayloadSize(8);
  rf.setChannel(124);
  rf.setDataRate(RF24_250KBPS);
  rf.openWritingPipe(0xB16B00B500LL); //big boobs!
  rf.printDetails();
}

void loop(void)
{
  int payload[6] = { 0 };
  for (int i = 0; i < 6; i++) {
    payload[i] = map(analogRead(i), 0, 1023, 0, 179);
  }
  rf.write( &payload, sizeof(payload));
}
    
